package com.cwj.springboot_study.controller;

import com.cwj.springboot_study.service.PersonService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author wujie.chen
 * 2021/12/29 14:17
 */
@RestController
@RequestMapping("/")
public class LoginController {

    @Resource
    private PersonService personService;

    @PostMapping("/login")
    public void login(String username, String password){
        personService.login(username, password);
    }

    @PostMapping("/register")
    public void register(String username, String password){
        personService.register(username, password);
    }
}
